var toTop = document.querySelector("#toTop");



window.onscroll = function(){
    console.log(document.documentElement.scrollTop || document.body.scrollTop);


    if(document.documentElement.scrollTop > 1 || document.body.scrollTop){
        toTop.style.display = 'block';
    }else{
        toTop.style.display = 'none';
    }
};


toTop.addEventListener('click',function(){
        window.scrollTo(0,0);//



    //window.scrollTo({
    //    top:0,
    //    behavior:'smooth'
    //
    //});
});